package com.springmvc.compositeentitypattern.client;

import com.springmvc.compositeentitypattern.entity.CompositeEntity;

/**
 * @author：ZDY
 * @Date：Created in 2020/12/13
 * @Description:创建使用组合实体的客户端类。
 */


public class Client {
    private CompositeEntity compositeEntity = new CompositeEntity();

    public void printData() {
        for (int i = 0; i < compositeEntity.getData().length; i++) {
            System.out.println("Data: " + compositeEntity.getData()[i]);
        }
    }

    public void setData(String data1, String data2) {
        compositeEntity.setData(data1, data2);
    }
}